<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<view>微信公众号关注组件</view>
		<view>
			<!-- #ifdef MP-WEIXIN -->
			<official-account></official-account>
			<!-- #endif -->
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<view>我再微信小程序下显示</view>
		<!-- #endif -->
		<!-- #ifdef H5 -->
		<button>我是H5按钮</button>
		<!-- #endif -->
		<uni-list>
			<uni-list-item title="音乐" note=""></uni-list-item>
			<uni-list-item title="电源" note=""></uni-list-item>
		</uni-list>
		<navigator url="/pages/home/home" open-type="navigate">
			<button>home页</button>
		</navigator>
		<button @click="taskPhone">拍照</button>
		<map style="width: 100%; height: 300px;" >
		</map>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {
			uni.showToast({
				title: '我是小程序'
			});

		},
		methods: {
			taskPhone() {
				const ctx = uni.createCameraContext()
				ctx.takePhoto({
					quality: 'high',
					success: (res) => {
						console.log(res, 'res---')
					}
				})
			}
		},
		async mounted() {
			const res = await uni.getSystemInfoAsync()
			console.log(res, 'res---123---')
			// // #ifndef H5
			// uni.scanCode({
			// 	success: (res) => {
			//       console.log(res.result,'')		 
			// 	}
			// })
			// // #endif
		},
		methods: {

		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>